package com.deng.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.deng.entity.Post;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.deng.vo.PostVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dengwenxiong
 * @since 2021-05-05
 */
@Mapper
@Repository
public interface PostMapper extends BaseMapper<Post> {
    //@Param(Constants.WRAPPER)是myabtisplus的特性，将wrapper自动生成SQL
    IPage<PostVo> selectPosts(Page page,@Param(Constants.WRAPPER) QueryWrapper wrapper);

    PostVo selectOnePost(@Param(Constants.WRAPPER) QueryWrapper<Post> wrapper);
}
